/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    position: relative;
    min-height: 100vh;
}

/* 屏幕切换 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* 登录界面样式 */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    text-align: left;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-btn i {
    margin-right: 8px;
}

/* 聊天界面样式 */
#chat-screen {
    background: #f5f6fa;
}

.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.chat-header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.room-info h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    margin-top: 4px;
}

.status.connected {
    color: #27ae60;
}

.status.disconnected {
    color: #e74c3c;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: #333;
}

/* 主聊天区域 */
.chat-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* 消息样式 */
.message {
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.message.own {
    text-align: right;
}

.message-content {
    display: inline-block;
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.own .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-username {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.message.own .message-username {
    color: rgba(255, 255, 255, 0.9);
}

.message-text {
    word-wrap: break-word;
    line-height: 1.4;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
    display: block;
}

.message.own .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* 系统消息 */
.message.system {
    text-align: center;
}

.message.system .message-content {
    background: #f0f0f0;
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
    border-radius: 20px;
    padding: 8px 12px;
}

/* 输入指示器 */
.typing-indicator {
    padding: 0 20px 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    min-height: 24px;
}

/* 用户侧边栏 */
.users-sidebar {
    width: 250px;
    background: white;
    border-left: 1px solid #e0e6ed;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.users-sidebar.hidden {
    transform: translateX(100%);
}

.users-header {
    padding: 20px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.users-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.user-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.users-list {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.user-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.user-item:hover {
    background: #f8f9fa;
    border-left-color: #667eea;
}

.user-item.current {
    background: #f0f4ff;
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.user-item i {
    color: #27ae60;
    font-size: 0.8rem;
}

/* 消息输入区 */
.message-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e6ed;
}

.message-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

#message-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

#message-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#send-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

#send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 通知样式 */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    min-width: 300px;
    animation: notificationSlide 0.3s ease;
    border-left: 4px solid #667eea;
}

@keyframes notificationSlide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left-color: #27ae60;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.warning {
    border-left-color: #f39c12;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-card {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .chat-main {
        flex-direction: column;
    }
    
    .users-sidebar {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        z-index: 100;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-input-container {
        padding: 15px;
    }
    
    .notifications {
        left: 20px;
        right: 20px;
    }
    
    .notification {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 20px;
    }
    
    .chat-header {
        padding: 10px 15px;
    }
    
    .messages {
        padding: 15px;
    }
    
    .message-input-container {
        padding: 10px;
    }
} 